///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug  4 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#ifdef WX_PRECOMP

#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#else
#include <wx/wx.h>
#endif //WX_PRECOMP

#include "setupgui.h"

// Using the construction of a static object to ensure that the help provider is set
class wxFBContextSensitiveHelpSetter
{
public:
wxFBContextSensitiveHelpSetter()
{
wxHelpProvider::Set( new wxSimpleHelpProvider );
}
};

static wxFBContextSensitiveHelpSetter s_wxFBSetTheHelpProvider;
///////////////////////////////////////////////////////////////////////////

SetupFrameGui::SetupFrameGui( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxVERTICAL );
	
	m_splitterV = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitterV->SetMinimumPaneSize( 150 );
	m_splitterV->Connect( wxEVT_IDLE, wxIdleEventHandler( SetupFrameGui::m_splitterVOnIdle ), NULL, this );
	m_panelSetup = new wxPanel( m_splitterV, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxVERTICAL );
	
	m_treeSetup = new wxTreeCtrl( m_panelSetup, ID_TREE_SETUP, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT );
	m_treeSetup->SetHelpText( _("tree") );
	
	bSizer3->Add( m_treeSetup, 1, wxEXPAND, 5 );
	
	m_panelSetup->SetSizer( bSizer3 );
	m_panelSetup->Layout();
	bSizer3->Fit( m_panelSetup );
	m_panelAttributes = new wxPanel( m_splitterV, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer13;
	bSizer13 = new wxBoxSizer( wxVERTICAL );
	
	m_pgmAttributes = new wxPropertyGridManager(m_panelAttributes, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPGMAN_DEFAULT_STYLE|wxPG_BOLD_MODIFIED|wxPG_DESCRIPTION|wxPG_HIDE_CATEGORIES);
	m_pgmAttributes->SetExtraStyle( wxPG_EX_LEGACY_VALIDATORS|wxPG_EX_MODE_BUTTONS ); 
	bSizer13->Add( m_pgmAttributes, 1, wxEXPAND | wxALL, 5 );
	
	m_panelAttributes->SetSizer( bSizer13 );
	m_panelAttributes->Layout();
	bSizer13->Fit( m_panelAttributes );
	m_splitterV->SplitVertically( m_panelSetup, m_panelAttributes, 236 );
	bSizer->Add( m_splitterV, 3, wxEXPAND, 5 );
	
	m_editLog = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
	bSizer->Add( m_editLog, 1, wxEXPAND, 5 );
	
	this->SetSizer( bSizer );
	this->Layout();
	m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
	m_menubar = new wxMenuBar( 0 );
	m_menuFile = new wxMenu();
	wxMenuItem* menuOpen;
	menuOpen = new wxMenuItem( m_menuFile, ID_FILE_OPEN, wxString( _("&Open ...") ) + wxT('\t') + wxT("CTRL-O"), _("Open a SetupCreator context ..."), wxITEM_NORMAL );
	m_menuFile->Append( menuOpen );
	
	wxMenuItem* menuSave;
	menuSave = new wxMenuItem( m_menuFile, ID_FILE_SAVE, wxString( _("&Save") ) + wxT('\t') + wxT("CTRL-S"), _("Save the setup file"), wxITEM_NORMAL );
	m_menuFile->Append( menuSave );
	
	wxMenuItem* menuSaveAs;
	menuSaveAs = new wxMenuItem( m_menuFile, ID_FILE_SAVE_AS, wxString( _("Save as ...") ) , _("Save the setup file to a specific name"), wxITEM_NORMAL );
	m_menuFile->Append( menuSaveAs );
	
	m_menuFile->AppendSeparator();
	
	wxMenuItem* menuExit;
	menuExit = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("E&xit") ) , _("Quit the Setup Creator"), wxITEM_NORMAL );
	m_menuFile->Append( menuExit );
	
	m_menubar->Append( m_menuFile, _("&File") );
	
	m_menuEdit = new wxMenu();
	wxMenuItem* menuAddChild;
	menuAddChild = new wxMenuItem( m_menuEdit, ID_EDIT_ADDCHILD, wxString( _("Add child...") ) + wxT('\t') + wxT("CTRL-A"), _("Add a child to the current item"), wxITEM_NORMAL );
	m_menuEdit->Append( menuAddChild );
	
	wxMenuItem* menuDeleteChild;
	menuDeleteChild = new wxMenuItem( m_menuEdit, ID_EDIT_DELCHILD, wxString( _("Delete child") ) + wxT('\t') + wxT("SHIFT-DEL"), _("Delete the current child and all its children"), wxITEM_NORMAL );
	m_menuEdit->Append( menuDeleteChild );
	
	wxMenuItem* menuCopy;
	menuCopy = new wxMenuItem( m_menuEdit, ID_EDIT_COPY, wxString( _("Copy") ) + wxT('\t') + wxT("CTRL-C"), _("Copy current element"), wxITEM_NORMAL );
	m_menuEdit->Append( menuCopy );
	
	wxMenuItem* menuPaste;
	menuPaste = new wxMenuItem( m_menuEdit, ID_EDIT_PASTE, wxString( _("Paste") ) + wxT('\t') + wxT("CTRL-V"), _("Paste element"), wxITEM_NORMAL );
	m_menuEdit->Append( menuPaste );
	
	m_menubar->Append( m_menuEdit, _("&Edit") );
	
	m_menuView = new wxMenu();
	wxMenuItem* menuPreview;
	menuPreview = new wxMenuItem( m_menuView, ID_VIEW_PREVIEW, wxString( _("Preview XML") ) , _("Preview the xml source"), wxITEM_NORMAL );
	m_menuView->Append( menuPreview );
	
	m_menubar->Append( m_menuView, _("&View") );
	
	m_menuHelp = new wxMenu();
	wxMenuItem* menuAbout;
	menuAbout = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("About...") ) + wxT('\t') + wxT("F1"), _("About Setup Creator"), wxITEM_NORMAL );
	m_menuHelp->Append( menuAbout );
	
	m_menubar->Append( m_menuHelp, _("&Help") );
	
	this->SetMenuBar( m_menubar );
	
	
	// Connect Events
	m_treeSetup->Connect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( SetupFrameGui::OnTreeSetupContextMenu ), NULL, this );
	m_treeSetup->Connect( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, wxTreeEventHandler( SetupFrameGui::OnTreeSetupRightClick ), NULL, this );
	m_treeSetup->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( SetupFrameGui::OnTreeSetupSelChanged ), NULL, this );
	m_treeSetup->Connect( wxEVT_COMMAND_TREE_SEL_CHANGING, wxTreeEventHandler( SetupFrameGui::OnTreeSetupSelChanging ), NULL, this );
	m_pgmAttributes->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( SetupFrameGui::OnPGAttributeChanged ), NULL, this );
	this->Connect( menuOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileOpen ) );
	this->Connect( menuSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileSave ) );
	this->Connect( menuSaveAs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileSaveAs ) );
	this->Connect( menuSaveAs->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateFileSaveAs ) );
	this->Connect( menuExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileExit ) );
	this->Connect( menuAddChild->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditAddChild ) );
	this->Connect( menuAddChild->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditAddChild ) );
	this->Connect( menuDeleteChild->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditDeleteChild ) );
	this->Connect( menuDeleteChild->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditDeleteChild ) );
	this->Connect( menuCopy->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditCopy ) );
	this->Connect( menuCopy->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditCopy ) );
	this->Connect( menuPaste->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditPaste ) );
	this->Connect( menuPaste->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditPaste ) );
	this->Connect( menuPreview->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnViewPreview ) );
	this->Connect( menuPreview->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateViewPreview ) );
	this->Connect( menuAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnHelpAbout ) );
}

SetupFrameGui::~SetupFrameGui()
{
	// Disconnect Events
	m_treeSetup->Disconnect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( SetupFrameGui::OnTreeSetupContextMenu ), NULL, this );
	m_treeSetup->Disconnect( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, wxTreeEventHandler( SetupFrameGui::OnTreeSetupRightClick ), NULL, this );
	m_treeSetup->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( SetupFrameGui::OnTreeSetupSelChanged ), NULL, this );
	m_treeSetup->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGING, wxTreeEventHandler( SetupFrameGui::OnTreeSetupSelChanging ), NULL, this );
	m_pgmAttributes->Disconnect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( SetupFrameGui::OnPGAttributeChanged ), NULL, this );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileOpen ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileSave ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileSaveAs ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateFileSaveAs ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnFileExit ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditAddChild ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditAddChild ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditDeleteChild ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditDeleteChild ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditCopy ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditCopy ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnEditPaste ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateEditPaste ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnViewPreview ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SetupFrameGui::OnUpdateViewPreview ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SetupFrameGui::OnHelpAbout ) );
}

DlgAddChildGui::DlgAddChildGui( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxHORIZONTAL );
	
	wxArrayString m_choiceElementChoices;
	m_choiceElement = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceElementChoices, 0 );
	m_choiceElement->SetSelection( 0 );
	bSizer->Add( m_choiceElement, 1, wxALL|wxEXPAND, 5 );
	
	m_btnOK = new wxButton( this, wxID_ANY, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer->Add( m_btnOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	this->SetSizer( bSizer );
	this->Layout();
	
	// Connect Events
	m_btnOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DlgAddChildGui::OnOK ), NULL, this );
}

DlgAddChildGui::~DlgAddChildGui()
{
	// Disconnect Events
	m_btnOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DlgAddChildGui::OnOK ), NULL, this );
}

DlgPreviewGui::DlgPreviewGui( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxVERTICAL );
	
	m_nbPreviews = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	
	bSizer->Add( m_nbPreviews, 1, wxEXPAND | wxALL, 5 );
	
	this->SetSizer( bSizer );
	this->Layout();
}

DlgPreviewGui::~DlgPreviewGui()
{
}

PanelEditorGui::PanelEditorGui( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxVERTICAL );
	
	m_scintilla = new wxScintilla( this, ID_EDITOR, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
	m_scintilla->SetUseTabs( true );
	m_scintilla->SetTabWidth( 4 );
	m_scintilla->SetIndent( 4 );
	m_scintilla->SetTabIndents( true );
	m_scintilla->SetBackSpaceUnIndents( true );
	m_scintilla->SetViewEOL( false );
	m_scintilla->SetViewWhiteSpace( false );
	m_scintilla->SetMarginWidth( 2, 0 );
	m_scintilla->SetIndentationGuides( true );
	m_scintilla->SetMarginType( 1, wxSCI_MARGIN_SYMBOL );
	m_scintilla->SetMarginMask( 1, wxSCI_MASK_FOLDERS );
	m_scintilla->SetMarginWidth( 1, 16);
	m_scintilla->SetMarginSensitive( 1, true );
	m_scintilla->SetProperty( wxT("fold"), wxT("1") );
	m_scintilla->SetFoldFlags( wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED );
	m_scintilla->SetMarginType( 0, wxSCI_MARGIN_NUMBER );
	m_scintilla->SetMarginWidth( 0, m_scintilla->TextWidth( wxSCI_STYLE_LINENUMBER, wxT("_99999") ) );
	m_scintilla->StyleSetFont( wxSCI_STYLE_DEFAULT, wxFont( wxNORMAL_FONT->GetPointSize(), 75, 90, 90, false, wxEmptyString ) );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDER, wxSCI_MARK_BOXPLUS );
	m_scintilla->MarkerSetBackground( wxSCI_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
	m_scintilla->MarkerSetForeground( wxSCI_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARK_BOXMINUS );
	m_scintilla->MarkerSetBackground( wxSCI_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
	m_scintilla->MarkerSetForeground( wxSCI_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDERSUB, wxSCI_MARK_EMPTY );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDEREND, wxSCI_MARK_BOXPLUS );
	m_scintilla->MarkerSetBackground( wxSCI_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
	m_scintilla->MarkerSetForeground( wxSCI_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARK_BOXMINUS );
	m_scintilla->MarkerSetBackground( wxSCI_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
	m_scintilla->MarkerSetForeground( wxSCI_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARK_EMPTY );
	m_scintilla->MarkerDefine( wxSCI_MARKNUM_FOLDERTAIL, wxSCI_MARK_EMPTY );
	m_scintilla->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
	m_scintilla->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
	m_scintilla->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 75, 90, 90, false, wxEmptyString ) );
	
	bSizer->Add( m_scintilla, 1, wxEXPAND|wxALL, 5 );
	
	this->SetSizer( bSizer );
	this->Layout();
}

PanelEditorGui::~PanelEditorGui()
{
}
